
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:mo="https://gitee.com/aun/Timo">
<body>
<div class="layui-card">

    <div class="layui-card-header">
        <span class="layui-icon font-s10 color-desc margin-right-5"></span>支付参数配置
        <div class="pull-right">
            <!--            <button data-table-id="NoticeTable" class="layui-btn layui-btn-primary  layui-btn-sm" data-modal="/system/user/form" data-height="720px" data-width="800px">-->
            <!--                <i class=" layui-icon layui-icon-addition"></i>新建护工</button>-->
        </div>
    </div>

    <div class="layui-card-line"></div>

    <div class="layui-card-body">
        <form action="/pcs/companyParam/form" class="layui-card layui-form" data-auto="true" method="post" data-table-id="contractTplTable">

            <input type="hidden" name="id" th:if="${vo}" th:value="${vo.id}"/>
            <div class="layui-card-body padding-15">

                <div class="layui-form-item">
                    <label class="layui-form-label ">微信商户号</label>
                    <div class="layui-input-block ">
                        <input type="text" name="mchId" required th:value="${vo?.mchId}" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label ">微信商户号密钥V2</label>
                    <div class="layui-input-block ">
                        <input type="text" name="apiKey" required th:value="${vo?.apiKey}" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label ">微信商户号私钥(字符串形式)</label>
                    <div class="layui-input-block ">
                        <input type="text" name="privateKey" required th:value="${vo?.privateKey}" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label ">微信商户证书序列号</label>
                    <div class="layui-input-block ">
                        <input type="text" name="mchNumber" required th:value="${vo?.mchNumber}" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label ">商户号证书文件路径</label>
                    <div class="layui-input-block ">
                        <input type="text" name="keyPath" required th:value="${vo?.keyPath}" class="layui-input">
<!--                        <input type="hidden"  name="keyPath" th:value="${vo?.keyPath}" >-->
<!--                        <button type="button" id="demo-class-accept" class="layui-btn font-code layui-btn-primary">-->
<!--                            <i class="layui-icon layui-icon-vercode"></i> 上传 商户号证书-->
<!--                        </button>-->
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label ">静态收款码</label>
                    <div class="layui-input-block ">
                        <input type="hidden"  name="payErw" th:value="${vo?.payErw}" >
                        <script>$("[name=payErw]").uploadOneImageNew();</script>
                        <style>
                            .uploadimage, .uploadfile{
                                width: 78px!important;
                                height: 78px!important;
                            }
                        </style>
                    </div>
                </div>



                <div class="text-center layui-form-actions1">
                    <button class="layui-btn" type="submit">保存</button>
                    <button class="layui-btn layui-btn-danger" data-close data-confirm="确定要取消编辑吗？" type='button'>关闭</button>
                </div>

            </div>
            <script>
                layui.use(function(){
                    var upload = layui.upload;
                    var layer = layui.layer;
                    // 渲染
                    upload.render({
                        elem: '#demo-class-accept', // 绑定多个元素
                        url: '/upload/image', // 此处配置你自己的上传接口即可
                        field:"image",
                        accept: 'file', // 普通文件
                        done: function(res){
                            if(res.code==1){
                                layer.msg('上传成功');
                                $("[name=keyPath]").val(res.data.url);
                            }else{
                                layer.msg('上传失败');
                            }

                            console.log(res);
                        }
                    });
                });
            </script>
        </form>
    </div>
</div>

</body>
</html>
